package com.zytlifeservice.controller.find;

import com.zytlifeservice.domain.Result;
import com.zytlifeservice.domain.find.RebateDescription;
import com.zytlifeservice.service.find.RebateDescriptionService;
import com.zytlifeservice.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 返利说明控制类
 * Created by Administrator on 2017/6/2.
 */
@RestController
@RequestMapping(value = "/rebate")
public class RebateDescriptionController {
   @Autowired
    private RebateDescriptionService rebateDescriptionService;//返利说明业务类

    @RequestMapping(value = "/explain")
    public Result findAll(){
        System.out.println("进入返利说明");
        List<RebateDescription> rebateDescriptionList=rebateDescriptionService.findRebateDescriptionALl();
        if(null!=rebateDescriptionList&&rebateDescriptionList.size()>0){
            return ResultUtil.success(rebateDescriptionList,"成功");
        }else{
            return ResultUtil.error(-1,"未获取到数据");
        }
    }
}
